package cn.cyty.midway.product.po;

import com.tuweisoft.tt.potts.pump.oo.annotion.Entity;
import com.tuweisoft.tt.potts.pump.oo.annotion.field.Primarykey;
import com.tuweisoft.tt.potts.pump.oo.annotion.field.choose.Item;
import com.tuweisoft.tt.potts.pump.oo.annotion.field.choose.PBoolean;
import com.tuweisoft.tt.potts.pump.oo.annotion.field.num.Money;
import com.tuweisoft.tt.potts.pump.oo.annotion.field.num.PInteger;
import com.tuweisoft.tt.potts.pump.oo.annotion.field.text.Text;
import com.tuweisoft.tt.potts.pump.oo.runtime.PumpObject;

@Entity(id="T_PRODUCT", title="商品", dataField="id")
public class Product implements PumpObject {

	private static final long serialVersionUID = -7194022080200276066L;

	@Text(id="PRODUCT_ID", title="编号", minLength=64, required=true, unique=true)
	@Primarykey
	private String id;
	
	@Text(id="PRODUCT_TITLE", title="商品名称", minLength=255, required=true)
	private String title;
	
	@Item(id="PRODUCT_CATEGORY", title="商品类目", required=true)
	private ProductCategory category;
	
	@Item(id="PRODUCT_BRAND", title="商品品牌", required=true)
	private ProductBrand brand;

	@Item(id="PRODUCT_SUPPLIER", title="供应商")
	private ProductSupplier supplier;
	
	@Item(id="PRODUCT_MANUFACTOR", title="制造商")
	private ProductManufactor manufactor;
	
	@Money(id="PRODUCT_PRICE", title="商品价格", required=true)
	private float price;
	
	@PInteger(id="PRODUCT_STOCK", title="库存数量")
	private int stock;
	
	@PInteger(id="PRODUCT_INDEX", title="排序")
	private int index;
	
	@PBoolean(id="PRODUCT_ISIN", title="是否上架")
	private boolean isin;
	
	@PBoolean(id="PRODUCT_TOP", title="是否置顶")
	private boolean top;
	
	@Text(id="PRODUCT_ICON", title="主图", minLength=255)
	private String icon;
	
	@Item(id="PRODUCT_STATE", title="状态")
	private ProductState state;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public ProductCategory getCategory() {
		return category;
	}

	public void setCategory(ProductCategory category) {
		this.category = category;
	}

	public float getPrice() {
		return price;
	}

	public void setPrice(float price) {
		this.price = price;
	}

	public int getStock() {
		return stock;
	}

	public void setStock(int stock) {
		this.stock = stock;
	}

	public int getIndex() {
		return index;
	}

	public void setIndex(int index) {
		this.index = index;
	}

	public boolean isIsin() {
		return isin;
	}

	public void setIsin(boolean isin) {
		this.isin = isin;
	}

	public boolean isTop() {
		return top;
	}

	public void setTop(boolean top) {
		this.top = top;
	}

	public String getIcon() {
		return icon;
	}

	public void setIcon(String icon) {
		this.icon = icon;
	}

	public ProductState getState() {
		return state;
	}

	public void setState(ProductState state) {
		this.state = state;
	}
	
}
